package it.softphone.cmc.server;


import it.softphone.commons.spring.ApplicationConfig;

import javax.servlet.ServletContextEvent;

import org.apache.shiro.web.env.EnvironmentLoaderListener;

public class Bootstrapper /*implements ServletContextListener*/ extends EnvironmentLoaderListener {

	public void contextInitialized(ServletContextEvent event) {
		super.contextInitialized(event);
		
		ApplicationConfig.Context ctx = ApplicationConfig.init( event.getServletContext() );
		
		ctx.addConfigClass( MainConfig.class);
		ctx.addBasePackage("it.softphone.cmc.server.config");
		//ctx.addBasePackage("it.soul.cmc.server.config");
		ctx.refresh();
		
	}

	public void contextDestroyed(ServletContextEvent event) {
		super.contextDestroyed(event);
		
		ApplicationConfig.shutdown();

	}

}
